import request from '@/utils/request'

// 设备列表
export function getEquipmentList (params) {
  return request({
  params,
  url: '/back/xsEquipment/getEquipmentList'
  })
  }

// 新增设备
export function addEquipment (data) {
  return request({
    method: 'post',
    data,
    url: '/back/xsEquipment/addEquipement'
  })
}

// 绑定设备
export function bindingEquipment (data) {
  return request({
    method: 'put',
    data,
    url: '/back/xsEquipment/binding'
  })
}

// 获取机柜信息
export function getEquipmentParam (data) {
  return request({
    data,
    method: 'post',
    url: '/back/xsEquipment/getEquipmentParam'
  })
}

// 获取机柜基本信息
export function getEquipmentInfo (params) {
  return request({
    params,
    method: 'get',
    url: '/back/xsEquipment/getEquipmentInfo'
  })
}

// 导入设备
export function importing (data) {
  return request({
    data,
    method: 'post',
    url: '/back/xsEquipment/importing'
  })
}

// 设置分成
export function setCommission (data) {
  return request({
    data,
    method: 'PUT',
    url: '/back/xsEquipment/setCommission'
  })
}

// 修改收费价格
export function updatePrice (data) {
  return request({
    data,
    method: 'PUT',
    url: '/back/xsEquipment/updatePrice'
  })
}

// 充电宝列表
export function getBatteryList (params) {
  return request({
    params,
    method: 'get',
    url: '/back/xsBattery/getBatteryList'
  })
}

// 导入充电宝
export function exportExcel (data) {
  return request({
    data,
    method: 'post',
    url: '/back/xsBattery/exportExcel'
  })
}
// 删除充电宝
export function delBattery (params) {
  return request({
    method: 'DELETE',
    params,
    url: '/back/xsBattery/delBattery'
  })
}

// 充电宝挂失或报损
export function updateBattery (data) {
  return request({
    method: 'PUT',
    data,
    url: '/back/xsBattery/updateBattery'
  })
}

// 新增充电宝
export function addBattery (data) {
  return request({
    method: 'POST',
    data,
    url: '/back/xsBattery/addBattery'
  })
}

//生成二维码
export function equipentDownloadQr (data) {
  return request({
    method: 'post',
    data,
    url: '/downloadQr'
  })
}

// 查看电源
export function getEnergy (params) {
  return request({
    method: 'get',
    params,
    url: '/back/xsBattery/getEnergy'
  })
}

// 弹出充电宝
export function popupEquipent (data) {
  return request({
    method: 'POST',
    data,
    url: '/back/xsEquipment/popupEquipent'
  })
}

// 删除机柜
export function delEquipent (data) {
  return request({
    method: 'put',
    data,
    url: '/back/xsEquipment/delEquipent'
  })
}